﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CPTECH.Business;
using System.Collections;
using System.IO;

namespace CPTECH.Presentation
{
    public partial class frm_lotes : frm_default
    {
        //endereços da pastas.
        String batch = (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\BatchFiles");
        String backUP = (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\BackUP");

        public frm_lotes()
        {
            InitializeComponent();
        }

        //volta para o form anterior.
        private void mnu_voltar_Click(object sender, EventArgs e)
        {
            this.closeForm();
        }

        //carrega os lotes á serem enviados.
        private void frm_lotes_Load(object sender, EventArgs e)
        {
            String[] LSFiles = Directory.GetFiles(batch, "*.LS");

            if (LSFiles.Length > 0)
            {
                for (int i = 0; i < LSFiles.Length; i++)
                {
                    lst_lotes.Items.Add(LSFiles[i]);
                }
            }
            else 
            {
                MessageBox.Show("Não existem lotes para serem enviados", "lista Lotes");
            }
        }
    }
}